import request from '@/router/axios';
import qs from 'qs';

/* 样品*/
// 条件分页查询
export const getSampleList = (data = {}) => request ({
    url: `/sample/v1/pageQuery?page=${data.page}&size=${data.size}`,
    method: 'post',
    data: data.sample
})

// 根据id查询样品
export const getSampleListById = (data = {}) => request ({
    url: `/sample/v1/findById`,
    method: 'post',
    data: qs.stringify(data)
})

// 新增样品
export const insertSample = (data) => request({
    url: '/sample/v1/insert',
    method: 'post',
    data: qs.stringify(data),
})

// 修改样品
export const updateSample = (data) => request({
    url: '/sample/v1/update',
    method: 'post',
    data: qs.stringify(data),
})

// 删除样品 -- 根据id
export const deleteSampleById = (data) => request({
  url: '/sample/v1/getById',
  method: 'post',
  data: qs.stringify(data),
})



/*样品分类*/
// 所有样品分类
export const getAllSampleTypeList = () => request ({
    url: '/sampleType/v1/findAllType',
    method: 'post'
})

// 新增 -- 样品分类
export const addSampleType = (data) => request({
    url: '/sampleType/v1/insert',
    method: 'post',
    data: qs.stringify(data)
})

// 修改 -- 样品分类
export const updateSampleType = (data) => request({
    url: '/sampleType/v1/update',
    method: 'post',
    data: qs.stringify(data),
})

// 根据id删除 -- 样品分类
export const delSampleTypeById = (data) => request({
    url: '/sampleType/v1/getById',
    method: 'post',
    data: qs.stringify(data),
})



/* 样品留样存储条件 */
// 条件分页查询
export const getSampleRetentionSaveList = (data) => request({
    url: '/sampleRetentionSave/v1/pageQuery',
    method: 'post',
    data: qs.stringify(data),
})

// 根据id查询
export const getSampleRetentionSaveListById = (data) => request({
    url: '/sampleRetentionSave/v1/findById',
    method: 'post',
    data: qs.stringify(data),
})

// 新增 -- 留样条件
export const addSampleRetentionSave= (data) => request({
    url: '/sampleRetentionSave/v1/insert',
    method: 'post',
    data: qs.stringify(data),
})

// 修改 -- 留样条件
export const updateSampleRetentionSave = (data) => request({
    url: '/sampleRetentionSave/v1/update',
    method: 'post',
    data: qs.stringify(data)
})

// 根据id删除 -- 留样条件
export const delSampleRetentionSaveById = (data) => request({
    url: '/sampleRetentionSave/v1/getById',
    method: 'post',
    data: qs.stringify(data),
})



/* 样品留样 */
// 条件分页查询 -- 样品留样
export const getSampleRetentionList = (data) => request({
    url: `/sampleRetention/v1/pageQuery?page=${data.page}&size=${data.size}`,
    method: 'post',
    data: data.sampleRetention,
})

// 根据主键查询 -- 样品留样
export const getSampleRetentionListById = (data) => request({
    url: '/sampleRetention/v1/findById',
    method: 'post',
    data: qs.stringify(data),
})

// 新增 -- 样品留样
export const addSampleRetention = (data) => request({
    url: '/sampleRetention/v1/insert',
    method: 'post',
    data: data,
})

// 修改 -- 样品留样
export const updateSampleRetention = (data) => request({
    url: '/sampleRetention/v1/update',
    method: 'post',
    data: data.sampleRetention ,
})

// 处理 -- 样品留样
export const handleSampleRetention = (data) => request({
    url: '/sampleRetention/v1/handle',
    method: 'post',
    data: qs.stringify(data),
})

// 撤销处理 -- 样品留样
export const cancelSampleRetention = (data) => request({
    url: '/sampleRetention/v1/revoke/handle',
    method: 'post',
    data: qs.stringify(data),
})

// 根据主键删除 -- 样品留样
export const delSampleRetentionById= (data) => request({
    url: '/sampleRetention/v1/getById',
    method: 'post',
    data: qs.stringify(data),
})

// 新增刘留样 -- 样品留样
export const getSampleRetentionInsert= (data) => request({
    url: '/sampleRetention/v1/insert',
    method: 'post',
    data: data
})

//查看所有设备文件数据
export const checkFileData = (data = {}) => request ({
    url: '/laboratoryFiles/v1/findAll',
    method: 'post',
    data: qs.stringify(data)
})


